import {Component, OnInit, ViewChild} from '@angular/core';
import {Globals} from "../../../globals";
import {LOG} from "../../../../../_mock/log";
import {BaseService} from "../../../shared/service/base.service";
import {LogLoginComponent} from './log-login/log-login.component';
import {LogClearComponent} from './log-clear/log-clear.component';
import {LogSystemComponent} from "./log-system/log-system.component";
import {LogAppComponent} from "./log-app/log-app.component";

@Component({
  selector: 'app-log',
  templateUrl: './log.component.html',
  styleUrls: ['./log.component.less']
})
export class LogComponent implements OnInit {

  isMobile = Globals.isMobile();
  // 搜索条件
  keyword: any = "";
  // 开始日期
  startDateTime: Date;
  // 结束日期
  endDateTime: Date;

  @ViewChild("logLogin")
  logLoginComponent: LogLoginComponent;
  @ViewChild("logClear")
  logClearComponent: LogClearComponent;
  @ViewChild("logSystem")
  logSystemComponent: LogSystemComponent;
  @ViewChild("logApp")
  logAppComponent: LogAppComponent;

  tabsIndex = 0;
  constructor(public baseService: BaseService) {
  }

  ngOnInit(): void {

  }

  // 子组件向这里（父组件）传值
  setDeleteInDateTimeSuccess($event: any) {
    if($event.deleteInDateTimeSuccess){
      this.logClearComponent.deleteInDateTimeSuccess();
    }
  }

  selectedIndexChange(data){
    this.tabsIndex = data;
  }
}
